from django.conf.urls import url, include
from django.contrib import admin
from .views import RegisterUsernameView,RegisterPhoneCountAPIView,RegisterCreateUserView,UserCenterInfoView,UserUpdateEmailView,AddressView,AddressDetailView,DefaultAddressDetailView,UserHistoryView,UserAuthorizationView
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [

    url(r'^usernames/(?P<username>\w{5,20})/count/$',RegisterUsernameView.as_view()),
    # GET /users/phones/(?P<mobile>1[345789]\d{9})/count/
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$',RegisterPhoneCountAPIView.as_view()),
    url(r'^$',RegisterCreateUserView.as_view()),
    url(r'^auths/',UserAuthorizationView.as_view()),
    url(r'^infos/',UserCenterInfoView.as_view()),
    url(r'^email/$',UserUpdateEmailView.as_view()),
    url(r'^addresses/$',AddressView.as_view()),
    url(r'^addresses/(?P<id>\d+)/$',AddressDetailView.as_view()),
    url(r'^addresses/(?P<id>\d+)/status/$',DefaultAddressDetailView.as_view()),
    url(r'^browerhistories/$',UserHistoryView.as_view()),

]